package day2018_lab02.test13;

public class Gymnastics extends ComperAverage{
    //去掉最高分和最低分
     double s11;
     double s22;
     double s33;
     double s44;
     double s55;

    public void setS11(double s11) {
        this.s11 = s11;
    }

    public double getS11() {
        return s11;
    }

    public void setS22(double s22) {
        this.s22 = s22;
    }

    public double getS22() {
        return s22;
    }

    public void setS33(double s33) {
        this.s33 = s33;
    }

    public double getS33() {
        return s33;
    }

    public void setS44(double s44) {
        this.s44 = s44;
    }

    public double getS44() {
        return s44;
    }

    public void setS55(double s55) {
        this.s55 = s55;
    }

    public double getS55() {
        return s55;
    }
//三目运算符作比较，求max
    double max(){
  double max =  s11>s22 ? s11:s22;
  max = max>s33 ? max:s33;
  max= max>s44? max:s44;
  max= max>s55?max:s55;
  return max;

    }
    double min(){
        double min = s11<s22?s11:s22;
        min= min<s33?min:s11;
        min= min<s44?min:s44;
        min = min<s55?min:s55;
        return min;
    }


    @Override
    double average() {
        return ((s11+s22+s33+s44+s55-min()-max())/3);
    }
}
